Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
interface System.​Numerics.​IFloatingPoint<​TSelf>
Assembly: System.Runtime
Implemented Interfaces
- IFloatingPointConstants`1 (Inherits: IEquatable<​TSelf>IFormattableIParsable<​TSelf>ISpanFormattableISpanParsable<​TSelf>IUtf8SpanFormattableIUtf8SpanParsable<​TSelf>IAdditionOperators<​TSelf, TSelf, TSelf>IAdditiveIdentity<​TSelf, TSelf>IDecrementOperators<​TSelf>IDivisionOperators<​TSelf, TSelf, TSelf>IEqualityOperators<​TSelf, TSelf, bool>IIncrementOperators<​TSelf>IMultiplicativeIdentity<​TSelf, TSelf>IMultiplyOperators<​TSelf, TSelf, TSelf>INumberBase<​TSelf>ISubtractionOperators<​TSelf, TSelf, TSelf>IUnaryNegationOperators<​TSelf, TSelf>IUnaryPlusOperators<​TSelf, TSelf>)
- INumber`1 (Inherits: IComparableIComparable<​TSelf>IEquatable<​TSelf>IFormattableIParsable<​TSelf>ISpanFormattableISpanParsable<​TSelf>IAdditionOperators<​TSelf, TSelf, TSelf>IAdditiveIdentity<​TSelf, TSelf>IComparisonOperators<​TSelf, TSelf, bool>IEqualityOperators<​TSelf, TSelf, bool>IDecrementOperators<​TSelf>IDivisionOperators<​TSelf, TSelf, TSelf>IIncrementOperators<​TSelf>IModulusOperators<​TSelf, TSelf, TSelf>IMultiplicativeIdentity<​TSelf, TSelf>IMultiplyOperators<​TSelf, TSelf, TSelf>INumberBase<​TSelf>IUtf8SpanFormattableIUtf8SpanParsable<​TSelf>ISubtractionOperators<​TSelf, TSelf, TSelf>IUnaryNegationOperators<​TSelf, TSelf>IUnaryPlusOperators<​TSelf, TSelf>)
- ISignedNumber`1 (Inherits: INumberBase<​TSelf>IEquatable<​TSelf>IFormattableIParsable<​TSelf>ISpanFormattableISpanParsable<​TSelf>IUtf8SpanFormattableIUtf8SpanParsable<​TSelf>IAdditionOperators<​TSelf, TSelf, TSelf>IAdditiveIdentity<​TSelf, TSelf>IDecrementOperators<​TSelf>IDivisionOperators<​TSelf, TSelf, TSelf>IEqualityOperators<​TSelf, TSelf, bool>IIncrementOperators<​TSelf>IMultiplicativeIdentity<​TSelf, TSelf>IMultiplyOperators<​TSelf, TSelf, TSelf>ISubtractionOperators<​TSelf, TSelf, TSelf>IUnaryNegationOperators<​TSelf, TSelf>IUnaryPlusOperators<​TSelf, TSelf>)
Defines a floating-point type.
Methods
static
TSelf
Ceiling​(TSelf x)
Computes the ceiling of a value.
Returns The ceiling of <paramref name="x" /> .
x
The value whose ceiling is to be computed.
static
TInteger
ConvertToInteger​(TSelf value)
Converts a value to a specified integer type using saturation on overflow
Returns An instance of <typeparamref name="TInteger" /> created from <paramref name="value" /> .
value
The value to be converted.
static
TInteger
ConvertToIntegerNative​(TSelf value)
Converts a value to a specified integer type using platform specific behavior on overflow.
Returns An instance of <typeparamref name="TInteger" /> created from <paramref name="value" /> .
value
The value to be converted.
static
TSelf
Floor​(TSelf x)
Computes the floor of a value.
Returns The floor of <paramref name="x" /> .
x
The value whose floor is to be computed.
int
GetExponentByteCount​()
Gets the number of bytes that will be written as part of <see cref="M:System.Numerics.IFloatingPoint`1.TryWriteExponentLittleEndian(System.Span{System.Byte},System.Int32@)" /> .
Returns The number of bytes that will be written as part of <see cref="M:System.Numerics.IFloatingPoint`1.TryWriteExponentLittleEndian(System.Span{System.Byte},System.Int32@)" /> .
int
GetExponentShortestBitLength​()
Gets the length, in bits, of the shortest two's complement representation of the current exponent.
Returns The length, in bits, of the shortest two's complement representation of the current exponent.
int
GetSignificandBitLength​()
Gets the length, in bits, of the current significand.
Returns The length, in bits, of the current significand.
int
GetSignificandByteCount​()
Gets the number of bytes that will be written as part of <see cref="M:System.Numerics.IFloatingPoint`1.TryWriteSignificandLittleEndian(System.Span{System.Byte},System.Int32@)" /> .
Returns The number of bytes that will be written as part of <see cref="M:System.Numerics.IFloatingPoint`1.TryWriteSignificandLittleEndian(System.Span{System.Byte},System.Int32@)" /> .
static
TSelf
Round​(TSelf x)
Rounds a value to the nearest integer using the default rounding mode ( <see cref="F:System.MidpointRounding.ToEven" /> ).
Returns The result of rounding <paramref name="x" /> to the nearest integer using the default rounding mode.
x
The value to round.
static
TSelf
Round​(TSelf x,
int digits)
Rounds a value to a specified number of fractional-digits using the default rounding mode ( <see cref="F:System.MidpointRounding.ToEven" /> ).
Returns The result of rounding <paramref name="x" /> to <paramref name="digits" /> fractional-digits using the default rounding mode.
x
The value to round.
digits
The number of fractional digits to which <paramref name="x" /> should be rounded.
static
TSelf
Round​(TSelf x,
int digits,
MidpointRounding mode)
Rounds a value to a specified number of fractional digits using the specified rounding mode.
Returns The result of rounding <paramref name="x" /> to <paramref name="digits" /> fractional-digits using <paramref name="mode" /> .
x
The value to round.
digits
The number of fractional digits to which <paramref name="x" /> should be rounded.
mode
The mode under which <paramref name="x" /> should be rounded.
static
TSelf
Round​(TSelf x,
MidpointRounding mode)
Rounds a value to the nearest integer using the specified rounding mode.
Returns The result of rounding <paramref name="x" /> to the nearest integer using <paramref name="mode" /> .
x
The value to round.
mode
The mode under which <paramref name="x" /> should be rounded.
static
TSelf
Truncate​(TSelf x)
Truncates a value.
Returns The truncation of <paramref name="x" /> .
x
The value to truncate.
bool
TryWriteExponentBigEndian​(Span<​byte> destination,
Int32& bytesWritten)
bool
TryWriteExponentLittleEndian​(Span<​byte> destination,
Int32& bytesWritten)
bool
TryWriteSignificandBigEndian​(Span<​byte> destination,
Int32& bytesWritten)
bool
TryWriteSignificandLittleEndian​(Span<​byte> destination,
Int32& bytesWritten)
int
WriteExponentBigEndian​(byte[] destination)
Writes the current exponent, in big-endian format, to a given array.
Returns The number of bytes written to <paramref name="destination" /> .
destination
The array to which the current exponent should be written.
int
WriteExponentBigEndian​(byte[] destination,
int startIndex)
Writes the current exponent, in big-endian format, to a given array.
Returns The number of bytes written to <paramref name="destination" /> starting at <paramref name="startIndex" /> .
destination
The array to which the current exponent should be written.
startIndex
The starting index at which the exponent should be written.
int
WriteExponentBigEndian​(Span<​byte> destination)
Writes the current exponent, in big-endian format, to a given span.
Returns The number of bytes written to <paramref name="destination" /> .
destination
The span to which the current exponent should be written.
int
WriteExponentLittleEndian​(byte[] destination)
Writes the current exponent, in little-endian format, to a given array.
Returns The number of bytes written to <paramref name="destination" /> .
destination
The array to which the current exponent should be written.
int
WriteExponentLittleEndian​(byte[] destination,
int startIndex)
Writes the current exponent, in little-endian format, to a given array.
Returns The number of bytes written to <paramref name="destination" /> starting at <paramref name="startIndex" /> .
destination
The array to which the current exponent should be written.
startIndex
The starting index at which the exponent should be written.
int
WriteExponentLittleEndian​(Span<​byte> destination)
Writes the current exponent, in little-endian format, to a given span.
Returns The number of bytes written to <paramref name="destination" /> .
destination
The span to which the current exponent should be written.
int
WriteSignificandBigEndian​(byte[] destination)
Writes the current significand, in big-endian format, to a given array.
Returns The number of bytes written to <paramref name="destination" /> .
destination
The array to which the current significand should be written.
int
WriteSignificandBigEndian​(byte[] destination,
int startIndex)
Writes the current significand, in big-endian format, to a given array.
Returns The number of bytes written to <paramref name="destination" /> starting at <paramref name="startIndex" /> .
destination
The array to which the current significand should be written.
startIndex
The starting index at which the significand should be written.
int
WriteSignificandBigEndian​(Span<​byte> destination)
Writes the current significand, in big-endian format, to a given span.
Returns The number of bytes written to <paramref name="destination" /> .
destination
The span to which the current significand should be written.
int
WriteSignificandLittleEndian​(byte[] destination)
Writes the current significand, in little-endian format, to a given array.
Returns The number of bytes written to <paramref name="destination" /> .
destination
The array to which the current significand should be written.
int
WriteSignificandLittleEndian​(byte[] destination,
int startIndex)
Writes the current significand, in little-endian format, to a given array.
Returns The number of bytes written to <paramref name="destination" /> starting at <paramref name="startIndex" /> .
destination
The array to which the current significand should be written.
startIndex
The starting index at which the significand should be written.
int
WriteSignificandLittleEndian​(Span<​byte> destination)
Writes the current significand, in little-endian format, to a given span.
Returns The number of bytes written to <paramref name="destination" /> .
destination
The span to which the current significand should be written.